package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.DeclarationActivityReportMapper;
import com.ruoyi.system.domain.DeclarationActivityReport;
import com.ruoyi.system.service.IDeclarationActivityReportService;
import com.ruoyi.common.core.text.Convert;

/**
 * 活动报表Service业务层处理
 * 
 * @author triangle
 * @date 2022-07-31
 */
@Service
public class DeclarationActivityReportServiceImpl implements IDeclarationActivityReportService 
{
    @Autowired
    private DeclarationActivityReportMapper declarationActivityReportMapper;

    /**
     * 查询活动报表
     * 
     * @param decId 活动报表主键
     * @return 活动报表
     */
    @Override
    public DeclarationActivityReport selectDeclarationActivityReportByDecId(Long decId)
    {
        return declarationActivityReportMapper.selectDeclarationActivityReportByDecId(decId);
    }

    /**
     * 查询活动报表列表
     * 
     * @param declarationActivityReport 活动报表
     * @return 活动报表
     */
    @Override
    public List<DeclarationActivityReport> selectDeclarationActivityReportList(DeclarationActivityReport declarationActivityReport)
    {
        return declarationActivityReportMapper.selectDeclarationActivityReportList(declarationActivityReport);
    }

    /**
     * 新增活动报表
     * 
     * @param declarationActivityReport 活动报表
     * @return 结果
     */
    @Override
    public int insertDeclarationActivityReport(DeclarationActivityReport declarationActivityReport)
    {
        declarationActivityReport.setCreateTime(DateUtils.getNowDate());
        return declarationActivityReportMapper.insertDeclarationActivityReport(declarationActivityReport);
    }

    /**
     * 修改活动报表
     * 
     * @param declarationActivityReport 活动报表
     * @return 结果
     */
    @Override
    public int updateDeclarationActivityReport(DeclarationActivityReport declarationActivityReport)
    {
        declarationActivityReport.setUpdateTime(DateUtils.getNowDate());
        return declarationActivityReportMapper.updateDeclarationActivityReport(declarationActivityReport);
    }

    /**
     * 批量删除活动报表
     * 
     * @param decIds 需要删除的活动报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationActivityReportByDecIds(String decIds)
    {
        return declarationActivityReportMapper.deleteDeclarationActivityReportByDecIds(Convert.toStrArray(decIds));
    }

    /**
     * 删除活动报表信息
     * 
     * @param decId 活动报表主键
     * @return 结果
     */
    @Override
    public int deleteDeclarationActivityReportByDecId(Long decId)
    {
        return declarationActivityReportMapper.deleteDeclarationActivityReportByDecId(decId);
    }
}
